home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Oct 89 / Z0012-Re View initializat-Oct89 < prev    next >
Encoding:
Text File  |  1989-10-04  |  1.0 KB  |  29 lines  |  [TEXT/GEOL]

  1. Item    7836064                         4-Oct-89        12:23
  2.  
  3. From:   BIANCHI1                        Bianchi, Curt
  4.  
  5. To:     D4132                           Farallon, R & D,PRT
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    Re: View initialization
  10.  
  11. Hi Joe,
  12.  
  13. You could do this in two steps by converting the view coordinates to window
  14. coordinates, and then converting the window coordinates to global coordinates.
  15. This is done by calling the view's LocalToWindow method, then calling the
  16. window's GetGlobalBounds method, which returns the window's global location in
  17. the topLeft point of its parameter, and then adding the result of LocalToWindow
  18. to the topLeft of the rect returned by GetGlobalBounds.  Neither of these
  19. methods requires focusing.  Something like this ought to work:
  20.  
  21.     aView.LocalToWindow(aVPoint);
  22.     aWindow.GetGlobalBounds(windowBounds);
  23.     globalViewLocation.h := aVPoint.h + windowBounds.left;
  24.     globalViewLocation.v := aVPoint.v + windowBounds.top;
  25.  
  26. Curt Bianchi
  27. Apple Computer
  28.  
  29.